package smarties.style;

import java.awt.Graphics2D;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import smarties.SmartEdge;
import smarties.SmartNode;

import com.touchgraph.graphlayout.TGPanel;

@XmlRootElement(name = "smartStyle")
public class SmartStyle
{
	@XmlElement(name = "color")
	private final SmartColor	color					= new SmartColor(255,
																0, 0, 0.2f);
	private int					percentVisualisation	= 0;

	public void setPercentVisualisation(int percent)
	{
		this.percentVisualisation = percent;
	}

	public int getPercentVisualisation()
	{
		return this.percentVisualisation;
	}

	public SmartColor getSmartColor()
	{
		return this.color;
	}

	public void paintNodeBody(SmartNode node, Graphics2D g,
			TGPanel<SmartNode, SmartEdge> tgPanel)
	{
		if (node.isSelected())
		{
			g.setColor(this.getSmartColor().getColor());
		}
		else
		{
			g.setColor(SmartNode.getUnselectedSmartColor().getColor());
		}

		node.defaultPointNodeBody(g, tgPanel);
	}
}
